using UnityEngine;

public class KineticServeHitElement : KineticElementMove
{
	public delegate void OnHitDelegate(KineticServeHitElement hit);

	private float animTime;

	public OnHitDelegate onHitDelegate;

	public HitAnimationInfo hitInfo
	{
		get
		{
			return animInfo as HitAnimationInfo;
		}
	}

	public override void EndAnimation()
	{
		isActive = false;
	}

	public override void OnStart(Transform character)
	{
		base.OnStart(character);
		animTime = 0f;
	}

	public override void OnLateUpdate()
	{
		if (!(base.animator == null))
		{
			float deltaTime = GGGameTime.deltaTime;
			animTime += deltaTime * animatorSpeed;
			float num = Mathf.Max(0f, hitInfo.hitTime - animTime);
			if (num - deltaTime * animatorSpeed <= 0f && !base.animator.IsInTransition(0) && this.onHitDelegate != null)
			{
				OnHitDelegate onHitDelegate = this.onHitDelegate;
				this.onHitDelegate = null;
				onHitDelegate(this);
			}
		}
	}
}
